
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>axisar_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>axisar_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void axisar_c ( ConstSpiceDouble  axis   [3],
                   SpiceDouble       angle,
                   SpiceDouble       r      [3][3]  ) 

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Construct a rotation matrix that rotates vectors by a specified 
   angle about a specified axis. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   <a href="../req/rotation.html">ROTATION</a> 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
   MATRIX 
   ROTATION 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   Variable  I/O  Description 
   --------  ---  -------------------------------------------------- 
   axis       I   Rotation axis. 
   angle      I   Rotation angle, in radians. 
   r          O   Rotation matrix corresponding to axis and angle. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   axis, 
   angle          are, respectively, a rotation axis and a rotation 
                  angle.  axis and angle determine a coordinate 
                  transformation whose effect on any vector v is to 
                  rotate v by angle radians about the vector axis. 
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   r              is a rotation matrix representing the coordinate 
                  transformation determined by axis and angle:  for 
                  each vector v, r*v is the vector resulting from 
                  rotating v by angle radians about axis. 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   Error free. 
 
   1)  If axis is the zero vector, the rotation generated is the 
       identity.  This is consistent with the specification of vrotv. 
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   <b>axisar_c</b> can be thought of as a partial inverse of <a href="raxisa_c.html">raxisa_c</a>.  
   <b>axisar_c</b> is really is a `left inverse':  the code fragment 
 
      <a href="raxisa_c.html">raxisa_c</a> ( r,    axis,  &amp;angle ); 
      <b>axisar_c</b> ( axis, angle, r      ); 
 
   preserves r, except for round-off error, as long as r is a 
   rotation matrix. 
 
   On the other hand, the code fragment 
 
      <b>axisar_c</b> ( axis, angle, r      ); 
      <a href="raxisa_c.html">raxisa_c</a> ( r,    axis,  &amp;angle ); 
 
   preserves axis and angle, except for round-off error, only if 
   angle is in the range (0, pi).  So <b>axisar_c</b> is a right inverse 
   of <a href="raxisa_c.html">raxisa_c</a> only over a limited domain. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   1)  A matrix that rotates vectors by pi/2 radians about the z-axis 
       can be found using the code fragment 
 
          axis[0] = 0. 
          axis[1] = 0. 
          axis[2] = 1. 
 
          <b>axisar_c</b> ( axis, <a href="halfpi_c.html">halfpi_c</a>(), r ); 
 
       The returned matrix r will equal 
 
          +-               -+ 
          |  0    -1     0  | 
          |                 | 
          |  1     0     0  |. 
          |                 | 
          |  0     0     1  | 
          +-               -+ 
 
 
   2)  Linear interpolation between two rotation matrices: 
 
          Let r(t) be a time-varying rotation matrix; r could be 
          a C-matrix describing the orientation of a spacecraft 
          structure.  Given two points in time t1 and t2 at which 
          r(t) is known, and given a third time t3, where 
 
             t1  &lt;  t3  &lt;  t2, 
 
          we can estimate r(t3) by linear interpolation.  In other 
          words, we approximate the motion of r by pretending that 
          r rotates about a fixed axis at a uniform angular rate 
          during the time interval [t1, t2].  More specifically, we 
          assume that each column vector of r rotates in this 
          fashion.  This procedure will not work if r rotates through 
          an angle of pi radians or more during the time interval 
          [t1, t2]; an aliasing effect would occur in that case. 
 
          If we let 
 
             r1 = r(t1) 
             r2 = r(t2), and 
 
                         -1 
             q  = r2 * r1  , 
 
          then the rotation axis and angle of q define the rotation 
          that each column of r(t) undergoes from time t1 to time 
          t2.  Since r(t) is orthogonal, we can find q using the 
          transpose of r1.  We find the rotation axis and angle via 
          <a href="raxisa_c.html">raxisa_c</a>. 
 
             <a href="mxmt_c.html">mxmt_c</a>   ( r2,   r1,    q      ); 
             <a href="raxisa_c.html">raxisa_c</a> ( q,    axis,  &amp;angle ); 
 
          Find the fraction of the total rotation angle that r 
          rotates through in the time interval [t1, t3]. 
 
             frac = ( t3 - t1 )  /  ( t2 - t1 ) 
 
          Finally, find the rotation delta that r(t) undergoes 
          during the time interval [t1, t3], and apply that rotation 
          to r1, yielding r(t3), which we'll call r3. 
 
             <b>axisar_c</b> ( axis,   frac * angle,  delta  ); 
             <a href="mxm_c.html">mxm_c</a>    ( delta,  r1,            r3     ); 
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   N.J. Bachman   (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
 
   -CSPICE Version 1.0.0, 18-JUN-1999 (NJB)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   axis and angle to rotation 
 </PRE>
<h4>Link to routine axisar_c source file <a href='../../../src/cspice/axisar_c.c'>axisar_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:18 2010</pre>

</body>
</html>

